package com.agent.membership.mapper;

import com.agent.membership.entity.MembershipPlan;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 会员套餐Mapper
 * @author Jeff_Wan
 * @description 会员套餐数据库操作接口
 */
@Mapper
public interface MembershipPlanMapper extends BaseMapper<MembershipPlan> {

    /**
     * 根据套餐类型和订阅类型查询
     * @param planType 套餐类型
     * @param subscriptionType 订阅类型
     * @return 会员套餐
     */
    @Select("SELECT * FROM membership_plan " +
            "WHERE plan_type = #{planType} AND subscription_type = #{subscriptionType}")
    MembershipPlan findByPlanAndSubscription(
            @Param("planType") String planType,
            @Param("subscriptionType") String subscriptionType);
}